package com.ricchieri.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.springframework.cache.annotation.Cacheable;

import com.ricchieri.dao.interf.ICharterTypeDao;
import com.ricchieri.filter.BasicFilter;
import com.ricchieri.model.CharterType;

public class CharterTypeDao extends GenericDao implements ICharterTypeDao {
	private static final long serialVersionUID = 895803046916188759L;

	@Override
	@Cacheable(value="charterType")
	@SuppressWarnings("unchecked")
	public List<CharterType> getAllCharterTypes(BasicFilter filter) {
		Criteria criteria = criteriaAllCharterType(filter);
		
		return criteria.list();
	}
	
	private Criteria criteriaAllCharterType(BasicFilter filter) {
		return super.criteriaAllBasic(filter, CharterType.class);
	}	
	
	@Override
	protected String getTableName() {
		return "charterType";
	}
}
